package view;

import java.awt.*;
import java.awt.event.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;

import javax.swing.*;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.LineBorder;

import model.*;
import control.*;

public class F_Booking extends JPanel {
	private JPanel contentPane;
	private JTextField txt_booking_from;
	private JFormattedTextField txt_date_to;
	private JTextField txt_customer_id;
	private JTextField txt_lname;
	private JTextField txt_fname;
	private JTextField txt_address;
	private JTextField txt_phonenumber;
	private JTextField txt_creditcard;
	private JTextField txt_numberid;
	JComboBox b__room;

	private Employee employee;
	RoomControl roomControl;
	CustomerControl customerControl;
	ReservationControl reservationControl;

	/**
	 * Launch the application.
	 */

	/**
	 * Create the frame.
	 */
	public F_Booking(F_Main f, final Employee employee) {

		this.employee = employee;

		roomControl = new RoomControl();
		customerControl = new CustomerControl();
		reservationControl = new ReservationControl();

		DateFormat format = new SimpleDateFormat("dd/mm/yyyy");
		// ------------------------------
		setBorder(new LineBorder(new Color(0, 0, 0)));
		JPanel p_customer = new JPanel();
		p_customer.setBorder(new LineBorder(new Color(0, 0, 0)));
		JLabel lblBookingFrom = new JLabel("Booking From (dd/mm/yyyy)");
		lblBookingFrom.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_booking_from = new JFormattedTextField(format);
		txt_booking_from.addKeyListener(new KeyListener() {
			public void keyTyped(KeyEvent e) {
				char c = e.getKeyChar();
				if (!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE)
						|| (c == KeyEvent.VK_DELETE) || (c == KeyEvent.VK_SLASH))) {
					JOptionPane.showMessageDialog(null, "Please Enter Valid");
					e.consume();
				}
			}

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyPressed(KeyEvent e) {
				// TODO Auto-generated method stub

			}
		});

		txt_booking_from.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_booking_from.setColumns(10);

		JLabel lblNewLabel = new JLabel("Days");
		lblNewLabel.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		// ------------------------------------
		final JComboBox b_type_room = new JComboBox();
		b_type_room.setAlignmentX(CENTER_ALIGNMENT);
		b_type_room.addItem("");
		ListCategory typerooms = roomControl.gettyperoom();
		Enumeration emp = typerooms.getListcategory().elements();
		while (emp.hasMoreElements()) {
			Category each = (Category) emp.nextElement();
			b_type_room.addItem(each);
		}

		b_type_room.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				b__room.removeAllItems();
				Category cate = (Category) b_type_room.getSelectedItem();
				Vector listrm = roomControl.findby_Category(cate
						.getCategory_id());
				Enumeration emp = listrm.elements();
				while (emp.hasMoreElements()) {
					Room each = (Room) emp.nextElement();
					b__room.addItem(each);
				}
			}
		});

		// ------------------------------------
		b_type_room.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		JLabel lblBookingTo = new JLabel("Booking To (dd/mm/yyyy)");
		lblBookingTo.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_date_to = new JFormattedTextField(format);
		txt_date_to.addKeyListener(new KeyListener() {

			public void keyTyped(KeyEvent e) {
				char c = e.getKeyChar();
				if (!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE)
						|| (c == KeyEvent.VK_DELETE) || (c == KeyEvent.VK_SLASH))) {
					JOptionPane.showMessageDialog(null, "Please Enter Valid");
					e.consume();
				}
			}

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyPressed(KeyEvent e) {
				// TODO Auto-generated method stub

			}
		});

		txt_date_to.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_date_to.setColumns(10);
		JLabel lblRoom = new JLabel("Type Room");
		lblRoom.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		// ----------------------------------------------------------
		b__room = new JComboBox();
		b__room.setAlignmentX(CENTER_ALIGNMENT);

		//
		// -----------------------------------------------------------

		b__room.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		JLabel lblRoom_1 = new JLabel("Room");
		lblRoom_1.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		// -----------------------------------------------------------

		String[] days = { "", "1", "2", "3", "4", "5", "6", "7", "8" };
		JComboBox b_days = new JComboBox(days);

		// -----------------------------------------------------------
		b_days.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		GroupLayout gl_p_customer = new GroupLayout(p_customer);
		gl_p_customer
				.setHorizontalGroup(gl_p_customer
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_p_customer
										.createSequentialGroup()
										.addGroup(
												gl_p_customer
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_p_customer
																		.createSequentialGroup()
																		.addGap(10)
																		.addComponent(
																				lblBookingFrom)
																		.addGap(6)
																		.addGroup(
																				gl_p_customer
																						.createParallelGroup(
																								Alignment.LEADING,
																								false)
																						.addGroup(
																								gl_p_customer
																										.createSequentialGroup()
																										.addComponent(
																												txt_booking_from,
																												GroupLayout.PREFERRED_SIZE,
																												146,
																												GroupLayout.PREFERRED_SIZE)
																										.addGap(17)
																										.addComponent(
																												lblNewLabel))
																						.addGroup(
																								Alignment.TRAILING,
																								gl_p_customer
																										.createSequentialGroup()
																										.addComponent(
																												b_type_room,
																												0,
																												GroupLayout.DEFAULT_SIZE,
																												Short.MAX_VALUE)
																										.addGap(18)
																										.addComponent(
																												lblRoom_1,
																												GroupLayout.PREFERRED_SIZE,
																												40,
																												GroupLayout.PREFERRED_SIZE))))
														.addGroup(
																gl_p_customer
																		.createSequentialGroup()
																		.addContainerGap()
																		.addComponent(
																				lblRoom)))
										.addGap(18)
										.addGroup(
												gl_p_customer
														.createParallelGroup(
																Alignment.LEADING,
																false)
														.addGroup(
																gl_p_customer
																		.createSequentialGroup()
																		.addComponent(
																				b_days,
																				GroupLayout.PREFERRED_SIZE,
																				52,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(18)
																		.addComponent(
																				lblBookingTo)
																		.addPreferredGap(
																				ComponentPlacement.RELATED)
																		.addComponent(
																				txt_date_to,
																				GroupLayout.PREFERRED_SIZE,
																				171,
																				GroupLayout.PREFERRED_SIZE))
														.addComponent(
																b__room,
																GroupLayout.PREFERRED_SIZE,
																145,
																GroupLayout.PREFERRED_SIZE))
										.addContainerGap()));
		gl_p_customer
				.setVerticalGroup(gl_p_customer
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_p_customer
										.createSequentialGroup()
										.addGap(7)
										.addGroup(
												gl_p_customer
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																txt_booking_from,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addGroup(
																gl_p_customer
																		.createSequentialGroup()
																		.addGap(3)
																		.addGroup(
																				gl_p_customer
																						.createParallelGroup(
																								Alignment.BASELINE)
																						.addComponent(
																								lblNewLabel)
																						.addComponent(
																								b_days,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								lblBookingTo)
																						.addComponent(
																								txt_date_to,
																								GroupLayout.PREFERRED_SIZE,
																								GroupLayout.DEFAULT_SIZE,
																								GroupLayout.PREFERRED_SIZE)))
														.addGroup(
																gl_p_customer
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				lblBookingFrom)))
										.addGap(18)
										.addGroup(
												gl_p_customer
														.createParallelGroup(
																Alignment.BASELINE)
														.addComponent(lblRoom)
														.addComponent(
																b_type_room,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(lblRoom_1)
														.addComponent(
																b__room,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(53)));
		p_customer.setLayout(gl_p_customer);

		JPanel p_booking = new JPanel();
		p_booking.setBorder(new LineBorder(new Color(0, 0, 0)));

		JLabel lblCustomerName = new JLabel("First name");
		lblCustomerName.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_customer_id = new JTextField();
		txt_customer_id.addKeyListener(new KeyListener() {

			public void keyTyped(KeyEvent e) {
				char c = e.getKeyChar();
				if (!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE)
						|| (c == KeyEvent.VK_DELETE) || (c == KeyEvent.VK_SLASH))) {
					JOptionPane.showMessageDialog(null, "Please Enter Valid");
					e.consume();
				}
			}

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyPressed(KeyEvent e) {
				// TODO Auto-generated method stub

			}
		});
		txt_customer_id.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_customer_id.setColumns(10);

		JLabel lblCustomerId = new JLabel("Customer id");
		lblCustomerId.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_lname = new JTextField();
		txt_lname.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_lname.setColumns(10);

		JLabel lblLastName = new JLabel("Last name");
		lblLastName.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_fname = new JTextField();
		txt_fname.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_fname.setColumns(10);

		JLabel lblAddress = new JLabel("Address");
		lblAddress.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_address = new JTextField();
		txt_address.setFont(new Font("Sitka Heading", Font.BOLD, 13));
		txt_address.setColumns(10);

		JPanel panel = new JPanel();
		panel.setBorder(null);

		JButton b_book = new JButton("Book");
		b_book.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub

				if (txt_booking_from.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill Date booking from");
				} else if (txt_date_to.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill Date booking to");

				} else if (txt_customer_id.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill Id customer");
				} else {
					Room eon = ((Room) b__room.getSelectedItem());
					Date booking_from = new Date(txt_booking_from.getText());
					Date booking_to = new Date(txt_date_to.getText());
					int room = eon.getID();
					int customer = Integer.parseInt(txt_customer_id.getText());
					boolean check = customerControl.check_customer(Integer
							.parseInt(txt_customer_id.getText()));
					System.out.println("aa");
					System.out.println("" + check);
					if (check == false) {
						System.out.println("vao ko");
						JOptionPane.showMessageDialog(null,
								"Not exits Id Customer ");
					}

					Reservation re = new Reservation();
					re.setExpected_arrive_date(booking_from);
					re.setExpected_departure_date(booking_to);
					re.setEmployee_reservation(employee.getID());
					re.setRoom_id(room);
					re.setCustomer_id(customer);
					re.setStatus(3);
					reservationControl.add_reservation(re);

				}
			}
		});
		b_book.setFont(new Font("Tahoma", Font.BOLD, 13));

		JButton b_close = new JButton("Close");

		b_close.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {

			}
		});

		b_close.setFont(new Font("Tahoma", Font.BOLD, 13));
		GroupLayout gl_panel = new GroupLayout(panel);
		gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(
				Alignment.LEADING).addGroup(
				Alignment.TRAILING,
				gl_panel.createSequentialGroup()
						.addContainerGap(244, Short.MAX_VALUE)
						.addComponent(b_book, GroupLayout.PREFERRED_SIZE, 111,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.UNRELATED)
						.addComponent(b_close, GroupLayout.PREFERRED_SIZE, 112,
								GroupLayout.PREFERRED_SIZE).addGap(134)));
		gl_panel.setVerticalGroup(gl_panel.createParallelGroup(
				Alignment.LEADING)
				.addGroup(
						gl_panel.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										gl_panel.createParallelGroup(
												Alignment.BASELINE)
												.addComponent(b_book)
												.addComponent(b_close))
								.addContainerGap(GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)));
		panel.setLayout(gl_panel);
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout
				.setHorizontalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																p_booking,
																Alignment.TRAILING,
																GroupLayout.DEFAULT_SIZE,
																611,
																Short.MAX_VALUE)
														.addComponent(
																p_customer,
																Alignment.TRAILING,
																GroupLayout.DEFAULT_SIZE,
																611,
																Short.MAX_VALUE)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addContainerGap()
																		.addComponent(
																				panel,
																				GroupLayout.PREFERRED_SIZE,
																				611,
																				GroupLayout.PREFERRED_SIZE)))
										.addContainerGap()));
		groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
				Alignment.LEADING).addGroup(
				groupLayout
						.createSequentialGroup()
						.addComponent(p_customer, GroupLayout.PREFERRED_SIZE,
								95, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.UNRELATED)
						.addComponent(p_booking, GroupLayout.PREFERRED_SIZE,
								182, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(panel, GroupLayout.PREFERRED_SIZE, 45,
								GroupLayout.PREFERRED_SIZE)
						.addContainerGap(50, Short.MAX_VALUE)));

		JLabel lblPhoneNumber = new JLabel("Phone number");
		lblPhoneNumber.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_phonenumber = new JTextField();
		txt_phonenumber.addKeyListener(new KeyListener() {

			public void keyTyped(KeyEvent e) {
				char c = e.getKeyChar();
				if (!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE)
						|| (c == KeyEvent.VK_DELETE) || (c == KeyEvent.VK_SLASH))) {
					JOptionPane.showMessageDialog(null, "Please Enter Valid");
					e.consume();
				}
			}// TODO Auto-generated method stub

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyPressed(KeyEvent e) {
				// TODO Auto-generated method stub

			}
		});
		txt_phonenumber.setColumns(10);
		txt_phonenumber.addKeyListener(new KeyListener() {

			public void keyTyped(KeyEvent e) {
				char c = e.getKeyChar();
				if (!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE)
						|| (c == KeyEvent.VK_DELETE) || (c == KeyEvent.VK_SLASH))) {
					JOptionPane.showMessageDialog(null, "Please Enter Valid");
					e.consume();
				}
			}// TODO Auto-generated method stub

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyPressed(KeyEvent e) {
				// TODO Auto-generated method stub

			}
		});

		JLabel lblCreditCard = new JLabel("Credit card");
		lblCreditCard.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_creditcard = new JTextField();
		txt_creditcard.addKeyListener(new KeyListener() {

			public void keyTyped(KeyEvent e) {
				char c = e.getKeyChar();
				if (!((c >= '0') && (c <= '9') || (c == KeyEvent.VK_BACK_SPACE)
						|| (c == KeyEvent.VK_DELETE) || (c == KeyEvent.VK_SLASH))) {
					JOptionPane.showMessageDialog(null, "Please Enter Valid");
					e.consume();
				}
			}// TODO Auto-generated method stub

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyPressed(KeyEvent e) {
				// TODO Auto-generated method stub

			}
		});
		txt_creditcard.setColumns(10);

		JLabel lblCmnd = new JLabel("Number ID");
		lblCmnd.setFont(new Font("Sitka Heading", Font.BOLD, 13));

		txt_numberid = new JTextField();
		txt_numberid.setColumns(10);

		JButton b_savecustomer = new JButton("Save Customer");
		b_savecustomer.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub

				if (txt_customer_id.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill Customer ID");
				} else if (txt_fname.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill First Name");
				} else if (txt_lname.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill First Name");
				} else if (txt_address.getText().equals("")) {
					JOptionPane.showMessageDialog(null, "Please fill Address");
				} else if (txt_numberid.getText().equals("")) {
					JOptionPane
							.showMessageDialog(null, "Please fill Number ID");
				} else if (txt_phonenumber.getText().equals("")) {
					JOptionPane.showMessageDialog(null, "Please fill Phone");
				} else if (txt_creditcard.getText().equals("")) {
					JOptionPane.showMessageDialog(null,
							"Please fill Credit Card");
				} else {
					try {
						int customer_id = Integer.parseInt(txt_customer_id
								.getText());
						String numberid = txt_numberid.getText();
						String firstname = txt_fname.getText();
						String lname = txt_lname.getText();
						String address = txt_address.getText();
						String phonenumber = (txt_phonenumber.getText());
						String creditcard = (txt_creditcard.getText());
						Customer cu = new Customer(customer_id, numberid,
								firstname, lname, address, phonenumber,
								creditcard);

						customerControl.add_Customer(cu);
					} catch (Exception ex) {
						JOptionPane
								.showMessageDialog(null,
										"input number for Customer id, numberid, phonenumber,creditcard");
					}
				}
			}
		});

		b_savecustomer.setFont(new Font("Tahoma", Font.BOLD, 13));

		JButton b_searchcustomer = new JButton("Search Customer");
		b_searchcustomer.setFont(new Font("Tahoma", Font.BOLD, 13));
		GroupLayout gl_p_booking = new GroupLayout(p_booking);
		gl_p_booking
				.setHorizontalGroup(gl_p_booking
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(10)
										.addComponent(lblCustomerId)
										.addGap(48)
										.addComponent(txt_customer_id,
												GroupLayout.PREFERRED_SIZE,
												251, GroupLayout.PREFERRED_SIZE))
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(10)
										.addComponent(lblLastName)
										.addGap(58)
										.addComponent(txt_fname,
												GroupLayout.PREFERRED_SIZE,
												251, GroupLayout.PREFERRED_SIZE)
										.addGap(6)
										.addComponent(lblCustomerName)
										.addGap(6)
										.addComponent(txt_lname,
												GroupLayout.PREFERRED_SIZE,
												167, GroupLayout.PREFERRED_SIZE))
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(10)
										.addComponent(lblAddress,
												GroupLayout.PREFERRED_SIZE, 70,
												GroupLayout.PREFERRED_SIZE)
										.addGap(48)
										.addComponent(txt_address,
												GroupLayout.PREFERRED_SIZE,
												493, GroupLayout.PREFERRED_SIZE))
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(10)
										.addComponent(lblPhoneNumber)
										.addGap(35)
										.addComponent(txt_phonenumber,
												GroupLayout.PREFERRED_SIZE,
												251, GroupLayout.PREFERRED_SIZE)
										.addGap(6)
										.addComponent(lblCmnd)
										.addGap(32)
										.addComponent(txt_numberid,
												GroupLayout.PREFERRED_SIZE,
												167, GroupLayout.PREFERRED_SIZE))
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(10)
										.addComponent(lblCreditCard)
										.addGap(53)
										.addComponent(txt_creditcard,
												GroupLayout.PREFERRED_SIZE,
												251, GroupLayout.PREFERRED_SIZE))
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(20)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																b_savecustomer)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(118)
																		.addComponent(
																				b_searchcustomer)))));
		gl_p_booking
				.setVerticalGroup(gl_p_booking
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								gl_p_booking
										.createSequentialGroup()
										.addGap(10)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				lblCustomerId))
														.addComponent(
																txt_customer_id,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(3)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				lblLastName))
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				txt_fname,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(3)
																		.addComponent(
																				lblCustomerName))
														.addComponent(
																txt_lname,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(6)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(5)
																		.addComponent(
																				lblAddress))
														.addComponent(
																txt_address,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(5)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																lblPhoneNumber)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(1)
																		.addComponent(
																				txt_phonenumber,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE))
														.addComponent(lblCmnd)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(1)
																		.addComponent(
																				txt_numberid,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE)))
										.addGap(6)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																gl_p_booking
																		.createSequentialGroup()
																		.addGap(2)
																		.addComponent(
																				lblCreditCard))
														.addComponent(
																txt_creditcard,
																GroupLayout.PREFERRED_SIZE,
																GroupLayout.DEFAULT_SIZE,
																GroupLayout.PREFERRED_SIZE))
										.addGap(5)
										.addGroup(
												gl_p_booking
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																b_savecustomer)
														.addComponent(
																b_searchcustomer))));
		p_booking.setLayout(gl_p_booking);
		setLayout(groupLayout);

	}

}
